<?php
/**
 * User: i@fedax.cn
 * Time: 2018/7/26 14:33
 */

namespace app\admin\model;

use think\model\concern\SoftDelete;

class Role extends ManageBase
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = true;

    public function getUpdateTimeAttr($value)
    {
        return date('Y-m-d', $value);
    }

    /**
     * @param $page_config
     * @return \think\Paginator
     * @throws \think\exception\DbException
     */
    public function getDataList($page_config)
    {
        return $this
            ->where('id', '<>', '1')
            ->field('id,role_name,update_time')
            ->order('id desc')
            ->paginate($page_config);
    }

}